// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'

Vue.config.productionTip = false

//引入echarts
window.echarts = require('echarts');

//引入echarts
import * as echarts from 'echarts';
Vue.prototype.$echarts=echarts

//引入 axios
import axios from 'axios'
//指定axios引用的根路径
axios.defaults.baseURL = "http://localhost:8000"
//全局注册，之后可以在其他组件中使用`this.$axios`发生数据调用
axios.interceptors.request.use((config) => {
  let token = sessionStorage.getItem("token");
  config.headers.token = token;
  return config;
});
Vue.prototype.$axios = axios

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
